import turtle as t
import random as r

t.colormode(255)


def squ(x, y):
    squ_x = r.randint(-100, 100)
    squ_y = r.randint(-100, 100)
    t.penup()
    t.goto(squ_x, squ_y)
    t.pendown()
    squ_red = r.randint(0, 255)
    squ_green = r.randint(0, 255)
    squ_blue = r.randint(0, 255)
    t.color(squ_red, squ_green, squ_blue)

    t.fillcolor(squ_red, squ_green, squ_blue)
    t.begin_fill()
    t.circle(100, steps=4)
    t.end_fill()


def cir(x, y):
    cir_x = r.randint(-100, 100)
    cir_y = r.randint(-100, 100)
    t.penup()
    t.goto(cir_x, cir_y)
    t.pendown()
    cir_red = r.randint(0, 255)
    cir_green = r.randint(0, 255)
    cir_blue = r.randint(0, 255)
    t.color(cir_red, cir_green, cir_blue)

    t.fillcolor(cir_red, cir_green, cir_blue)
    t.begin_fill()
    t.circle(100)
    t.end_fill()


def tri(x, y):
    tri_x = r.randint(-100, 100)
    tri_y = r.randint(-100, 100)
    t.penup()
    t.goto(tri_x, tri_y)
    t.pendown()
    tri_red = r.randint(0, 255)
    tri_green = r.randint(0, 255)
    tri_blue = r.randint(0, 255)
    t.color(tri_red, tri_green, tri_blue)

    t.fillcolor(tri_red, tri_green, tri_blue)
    t.begin_fill()
    t.circle(100, steps=3)
    t.end_fill()


t.onscreenclick(tri, 1)
t.onscreenclick(cir, 2)
t.onscreenclick(squ, 3)
t.done()

